package com.liuyang.concurrency.chapter8;

public class Test {
    public static void main(String[] args) {
        OhterService ohterService = new OhterService();
        DeadLock deadLock = new DeadLock(ohterService);
        ohterService.setDeadLock(deadLock);

        new Thread("t1"){
            @Override
            public void run() {
                while (true){
                    deadLock.m1();
                }
            }
        }.start();

        new Thread("t2"){
            @Override
            public void run() {
                while (true){
                    ohterService.s2();
                }
            }
        }.start();

    }
}
